Name Manta
OutFile manta.exe
VIProductVersion 0.0.0.1
VIAddVersionKey ProductName Manta
VIAddVersionKey CompanyName Duonex
VIAddVersionKey LegalCopyright "Chris Morgan"
VIAddVersionKey FileDescription Manta
VIAddVersionKey FileVersion 0.0.0.1
VIAddVersionKey InternalName Manta
VIAddVersionKey OriginalFilename manta.exe
SilentInstall Silent
RequestExecutionLevel user
SetCompressor lzma
Icon graphics\manta.ico
!include FileFunc.nsh
!insertmacro GetParameters

Section Manta
	SetOutPath $EXEDIR
	ReadINIStr $0 $EXEDIR\manta.exe.ini PHP-GTK Path
	IfErrors +2
	IfFileExists $0 Run

	StrCpy $0 $PROGRAMFILES\PHP-GTK\php-win.exe
	IfFileExists $0 Run

	StrCpy $0 $EXEDIR\PHP-GTK\php-win.exe
	IfFileExists $0 Run

	StrCpy $0 $EXEDIR\php-win.exe
	IfFileExists $0 Run

	ReadINIStr $0 $EXEDIR\manta.exe.ini PHP-GTK Path
	IfErrors 0 +4
	WriteINIStr $EXEDIR\manta.exe.ini PHP-GTK Path $PROGRAMFILES\PHP-GTK\php-win.exe
	MessageBox MB_ICONSTOP|MB_OK "Unable to find PHP-GTK!$\r$\n$\r$\nPlease set it in $EXEDIR\manta.exe.ini (sample created)."
	Abort
	MessageBox MB_ICONSTOP|MB_OK "Unable to find PHP-GTK specified in $EXEDIR\manta.exe.ini!$\r$\n$\r$\nValue provided: $0$\r$\n$\r$\nPlease set it to a valid executable."
	Abort

	Run:
	${GetParameters} $1
	Exec `"$0" manta.php $1`
SectionEnd
